/** 
 * File-Name:WebContent.java
 *
 * Created on 2010-11-20 下午06:15:14
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package org.neocrawler.entity;

import java.util.Date;
import java.util.UUID;

/**
 * Description:
 * 
 * @author: Neo (neolimeng@gmail.com) Software Engineering Institute, Peking
 *          University, China
 * @version 1.0 2010-11-20 下午06:15:14
 */
public class WebContent {
	private String uuid = UUID.randomUUID().toString();
	private String url;
	private String parentUrl;
	private String parentUuid;
	private String localStorePath;
	public static final String STATUS_UNKNOWN = "UNKNOWN";
	public static final String STATUS_OK = "OK";
	public static final String STATUS_ERROR = "ERROR";
	public static final String STATUS_EXCEPTION = "EXCEPTION";
	private String status = STATUS_UNKNOWN;
	public static final String TYPE_SEED_PAGE = "SEED_PAGE";
	public static final String TYPE_NOT_SPECIFIED = "NOT_SPECIFIED";
	private String type = TYPE_NOT_SPECIFIED;
	private String exceptionName;
	private String exceptionStackTrace;
	private String remarks;
	private String httpStatusCode;
	private String httpStatusLine;
	private String reserve01;
	private String reserve02;
	private String reserve03;
	private String reserve04;
	private String reserve05;
	private Date entityDate = new Date();

	public boolean equals(Object object) {
		try {
			return object instanceof WebContent
					&& url.equals(((WebContent) object).getUrl());
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	public int hashCode() {
		if (url != null) {
			return url.length();
		} else {
			return 0;
		}
	}

	// ===== Getters and Setters =====//
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getLocalStorePath() {
		return localStorePath;
	}

	public void setLocalStorePath(String localStorePath) {
		this.localStorePath = localStorePath;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getExceptionStackTrace() {
		return exceptionStackTrace;
	}

	public void setExceptionStackTrace(String exceptionStackTrace) {
		this.exceptionStackTrace = exceptionStackTrace;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getHttpStatusLine() {
		return httpStatusLine;
	}

	public void setHttpStatusLine(String httpStatusLine) {
		this.httpStatusLine = httpStatusLine;
	}

	public String getExceptionName() {
		return exceptionName;
	}

	public void setExceptionName(String exceptionName) {
		this.exceptionName = exceptionName;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getHttpStatusCode() {
		return httpStatusCode;
	}

	public void setHttpStatusCode(String httpStatusCode) {
		this.httpStatusCode = httpStatusCode;
	}

	public String getParentUrl() {
		return parentUrl;
	}

	public void setParentUrl(String parentUrl) {
		this.parentUrl = parentUrl;
	}

	public String getReserve01() {
		return reserve01;
	}

	public void setReserve01(String reserve01) {
		this.reserve01 = reserve01;
	}

	public String getReserve02() {
		return reserve02;
	}

	public void setReserve02(String reserve02) {
		this.reserve02 = reserve02;
	}

	public String getReserve03() {
		return reserve03;
	}

	public void setReserve03(String reserve03) {
		this.reserve03 = reserve03;
	}

	public String getReserve04() {
		return reserve04;
	}

	public void setReserve04(String reserve04) {
		this.reserve04 = reserve04;
	}

	public String getReserve05() {
		return reserve05;
	}

	public void setReserve05(String reserve05) {
		this.reserve05 = reserve05;
	}

	public Date getEntityDate() {
		return entityDate;
	}

	public void setEntityDate(Date entityDate) {
		this.entityDate = entityDate;
	}

	public String getParentUuid() {
		return parentUuid;
	}

	public void setParentUuid(String parentUuid) {
		this.parentUuid = parentUuid;
	}

}
